#ifndef FOCUSITEM_H
#define FOCUSITEM_H

#include <QGraphicsRectItem>
#include "Defs.h"

class FocusItem : public QGraphicsRectItem
{
public:
    enum PosInHost{NORTH_MIDDLE, NORTH_EAST,
                   EAST_MIDDLE, SOUTH_EAST,
                   SOUTH_MIDDLE, SOUTH_WEST,
                   WEST_MIDDLE, NORTH_WEST};
    enum { Type = UserType + 1 };
    enum FocusType{RESIZE, ROTATE};

    FocusItem(PosInHost pos, FocusType type, QGraphicsItem *parent);
    FocusItem(qreal len, PosInHost pos, FocusType type, QGraphicsItem *parent);

    int type() const {return Type;}
    void setInHost(PosInHost pos){m_posInHost = pos;}
    PosInHost getInHost(){return m_posInHost;}
    void setFocusType(FocusType type){m_type = type;}
    FocusType getFocusType(){return m_type;}
    void setWidth(qreal width){m_width = width;}
    void setHeight(qreal height){m_height = height;}
    void setDegree(qreal degree){m_degree = degree;}
    void locateInHost();

protected:
    void hoverEnterEvent (QGraphicsSceneHoverEvent * event) ;
    void hoverLeaveEvent (QGraphicsSceneHoverEvent * event) ;

private:
    PosInHost m_posInHost;
    FocusType m_type;
    qreal m_size;
    qreal m_degree;
    qreal m_width;
    qreal m_height;
    
};

#endif // FOCUSITEM_H
